home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 53 / IOPROG_53.ISO / soft / c++ / xceedbkp.exe / Recovery Wizard / Sources / clsDateList.cls < prev    next >
Encoding:
Visual Basic class definition  |  1999-09-02  |  1.2 KB  |  52 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "clsDateList"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = False
  14. Option Explicit
  15.  
  16. Private mnCount As Integer
  17. Private madtDates() As Date
  18.  
  19. Property Get Count() As Integer
  20.     Count = mnCount
  21. End Property
  22.  
  23. Property Get FileDate(nIndex As Integer) As Date
  24.     If nIndex < 0 Or nIndex > mnCount - 1 Then
  25.         FileDate = DateSerial(1900, 1, 1)
  26.     Else
  27.         FileDate = madtDates(nIndex)
  28.     End If
  29. End Property
  30.  
  31. Public Sub AddItem(dtFileDate As Date)
  32.     Dim i As Integer
  33.     
  34.     For i = 0 To mnCount - 1
  35.         If madtDates(i) = dtFileDate Then
  36.             Exit Sub
  37.         End If
  38.     Next i
  39.     
  40.     If mnCount = UBound(madtDates) - LBound(madtDates) + 1 Then
  41.         ReDim Preserve madtDates(0 To mnCount + 9) As Date
  42.     End If
  43.     
  44.     madtDates(mnCount) = dtFileDate
  45.     mnCount = mnCount + 1
  46. End Sub
  47.  
  48. Private Sub Class_Initialize()
  49.     mnCount = 0
  50.     ReDim madtDates(0 To 9) As Date
  51. End Sub
  52.